using UnityEngine;
using System.Collections;

public class CheckpointBehavior : MonoBehaviour 
{
	
	private ParticleSystem m_ps_particleSystem;
	
	private CheckpointManager m_manager;
	
	//private bool b_isActive;
	
	private Color m_EnableColor = Color.white;
	private Color m_DisableColor = Color.black;
	
	public float RotationSpeed = 10;
	
	// Use this for initialization
	void Start () 
	{
		/*
		m_ps_particleSystem = this.GetComponent<ParticleSystem>();
		m_ps_particleSystem.startColor = m_DisableColor;
		//m_ps_particleSystem.Stop();
		m_ps_particleSystem.Play();
		
		GameObject goCheckpointManager = GameObject.Find("CheckpointManager");
		m_manager = goCheckpointManager.GetComponent<CheckpointManager>();
		
		
		if(m_manager.SelectedCheckpoint == this)
			Enable();
			*/
	}
	
	// Update is called once per frame
	void Update () 
	{
		/*
		float ZRotation = 0;
		if(b_isActive)
			ZRotation = transform.rotation.eulerAngles.z + RotationSpeed * Time.deltaTime;
		else
			ZRotation = transform.rotation.eulerAngles.z - RotationSpeed * Time.deltaTime;
		
		transform.rotation = Quaternion.Euler(new Vector3(0, 0, ZRotation));
		*/
	}
	
	public void Enable()
	{
		/*
		m_ps_particleSystem.startColor = m_EnableColor;
		//m_ps_particleSystem.Play();
		m_manager.SelectedCheckpoint = this;
		b_isActive = true;
		*/
	}
	
	public void Disable()
	{
		/*
		m_ps_particleSystem.startColor = m_DisableColor;
		//m_ps_particleSystem.Stop();
		m_manager.SelectedCheckpoint = null;
		b_isActive = false;
		*/
	}
	
	void OnTriggerEnter(Collider other)
	{
		/*
		Debug.Log("trigger collision " + other.gameObject.name);
		m_manager.setSelectedCheckpoint(this);
		*/
	}
}
